//
//  DCProjectTool.m
//  Demo
//
//  Created by zhaolin on 2023/1/12.
//

#import "DCProjectTool.h"

@implementation DCProjectTool
+(UIViewController*)topVC {
    
    return nil;
}

//邮箱验证
+ (BOOL)isValidateEmail:(NSString *)email {
    NSString *emailRegex = @"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+.[A-Za-z]{2,4}";
    NSPredicate *emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", emailRegex];
    return [emailTest evaluateWithObject:email];
}

//BVN格式验证
+ (BOOL)isBVNText:(NSString *)str{
    if(str.length != 11) {
        return NO;
    }
    NSString * regex = @"(/^[0-9]*$/)";
    NSPredicate * pred = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regex];
    BOOL isMatch = [pred evaluateWithObject:str];
    if (isMatch) {
        return YES;
    }else{
        return NO;
    }
}
@end
